﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Database.Model.TrainingsRequestsExt>" %>

<%
    var coursesCol = new CRM.Database.Model.TrainingsCoursesCollection();
%>

<%
    Html.DevExpress().ComboBox(settings =>
    {
        settings.Name = "IdTrainingsCourse";
        settings.CallbackRouteValues = new { Controller = "TC", Action = "TrainingsRemoteRequestEditCoursesPartial" };
        settings.Properties.ValueType = typeof(int);
        settings.Properties.TextField = "Name";
        settings.Width = 500;
        settings.Properties.ValueField = "IdTrainingsCourse";
        settings.Properties.EnableCallbackMode = true;
        settings.Properties.ClientSideEvents.SelectedIndexChanged = "function(s, e) { IdTrainingsAuditorium.PerformCallback();  }";
    }).BindList(coursesCol.GetFullDefinedCoursesByCourseType(2).OrderBy(p => p.Name)).Bind(Model.IdTrainingsCourse).GetHtml();    
%>